#include <iostream>
using namespace std;

#define SHOOT_NUM 3
#define SCORE 28

int nCount = 0;                                                     
int o[SHOOT_NUM];
inline void ProcessOutPut(){                                                                            
	int sum=0;
	for(int i=0;i<SHOOT_NUM;i++){
		sum+=o[i];
	}
	if(sum!=SCORE)
		return;
	cout<<nCount++<<": ";
	for(int i=0;i<SHOOT_NUM;i++){
		cout<<o[i]<<"  ";
	}
	cout<<endl;
}                                  
                                                                             
void shoot(int *t,int n=0){                                                                            
	if(n== SHOOT_NUM-1){ 
		for(int j=0;j<=11;j++){                                     
			o[n] = t[j];                   
			ProcessOutPut();                    
		}                                                            
		return;                                   
	}                                                                    
	for(int i=0;i<11;i++){                               
		o[n] = t[i];                            
		shoot(t,n+1);                           
	}                                      
}                                                                        
                                                                             
int main(int argc, char* argv[]){                                                                            
	int targets[]={0,1,2,3,4,5,6,7,8,9,10};
	shoot(targets);                                                  
	return 0;                                                            
}

